<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="test1.MTAQuestion" %>
<%@ page import="test1.MTAQuestionBank" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>期中作业</title>
</head>
<body>
    <%!
       int i=0;
       private MTAQuestion[] mQuestions= MTAQuestionBank.getQuestions();
%>
判断题（一题两分，共20分）<br>
<form action="" method="post">
<%
    for(i=0;i<mQuestions.length;i++) {
        out.print(mQuestions[i].getQuestion() + "<br>");
//    }
    %>

     <input type="radio" name="answer<%=i%>" value="correct"   />对
        <input type="radio" name="answer<%=i%>" value="wrong"  />错<br/>
    <% } %>
    </form>


<%--     <%
    if(request.getParameter("next")!=null)
        i=(i+1) % mQuestions.length;   
    out.print(mQuestions[i].getQuestion()); 
     %>  --%>

    <form action="" method="post" name="frmnext">
    <input type="submit" name="next" value="下一题" />
    </form>
    <%
        String mAnswer=request.getParameter("answer");
        boolean mTrueQuestion;
        if(mAnswer!=null){
    	  if(mAnswer.equals("correct"))
             mTrueQuestion=true;
          else
    	     mTrueQuestion=false;
    %>

	<%
	}
	%>
</body>
</html>